﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace GMAC.ReportingSystem.Business.Entities
{
    /// <summary>
    /// Represents the levels of security for the entities.
    /// </summary>
    [Serializable]
    public class EntitySecurity
    {
        /// <summary>
        /// Gets or sets the entity id.
        /// </summary>
        /// <value>The entity id.</value>
        [XmlAttribute("id")]
        public int EntityID { get; set; }

        /// <summary>
        /// Gets or sets the name of the entity.
        /// </summary>
        /// <value>The name of the entity.</value>
        [XmlAttribute("name")]
        public string EntityName { get; set; }

        /// <summary>
        /// Gets or sets the display name.
        /// </summary>
        /// <value>The display name.</value>
        [XmlAttribute("display")]
        public string DisplayName { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the role can insert an entity.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this role can insert; otherwise, <c>false</c>.
        /// </value>
        [XmlAttribute("insert")]
        public bool CanInsert { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the role can read this entity.
        /// </summary>
        /// <value><c>true</c> if this role can read; otherwise, <c>false</c>.</value>
        [XmlAttribute("read")]
        public bool CanRead { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the role can write this entity.
        /// </summary>
        /// <value><c>true</c> if this role can write; otherwise, <c>false</c>.</value>
        [XmlAttribute("write")]
        public bool CanWrite { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the role can delete this entity.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this role can delete; otherwise, <c>false</c>.
        /// </value>
        [XmlAttribute("delete")]
        public bool CanDelete { get; set; }

        //[XmlAttribute("annuled")]
        //public bool CanAnnuled { get; set; }

        //[XmlAttribute("approve_flat_amount")]
        //public bool CanApproveFlatAmount { get; set; }
    }

    /// <summary>
    /// A collection of EntitySecurity
    /// </summary>
    public class EntitiesSecurityCollection : List<EntitySecurity>
    { }
}
